import { ref } from "vue"
import PageTable from "@/components/page-table"

export default function usePageSearch() {
  const pageTableRef = ref<InstanceType<typeof PageTable>>()

  // 搜索组件发出的搜索或重置指令
  const handlerSearch = (info: any) => {
    // 接收数据
    console.log("接受了事件")

    pageTableRef.value?.getPageDate(info)
  }

  return [pageTableRef, handlerSearch]
}

export const pageTableRef = ref<InstanceType<typeof PageTable>>()

export const handlerSearch = (info: any) => {
  // 接收数据
  console.log("接受了事件")

  pageTableRef.value?.getPageDate(info)
}
